{extend name="../../admin/view/main"}

{block name="content"}
<div class="layui-tab layui-tab-card think-bg-white">
    <ul class="layui-tab-title">
        {php}$types = ['t1' => '预订单', 't2' => '已支付', 't3' => '已取消'];{/php}
        {foreach $types as $k=>$v}
        {if isset($type) and 't'.$type eq $k}
        <li class="layui-this" data-open="{:url('index')}?type={$k}">{$v}<sup class="layui-badge border-radius">{$total[$k]??0}</sup></li>
        {else}
        <li data-open="{:url('index')}?type={$k}">{$v}<sup class="layui-badge border-radius">{$total[$k]??0}</sup></li>
        {/if}
        {/foreach}
    </ul>
    <div class="layui-tab-content">
        {include file='integral_order_controller/index_search'}
        <table class="layui-table margin-top-10" lay-skin="line">
            {notempty name='list'}
            <thead>
            <tr>
                <th class='text-left nowrap'>应用</th>
                <th class='text-left nowrap'>订单号</th>
                <th class='text-left nowrap'>代理</th>
                <th class='text-left nowrap'>积分套餐</th>
                <th class='text-left nowrap'>订单金额/元</th>
                <th class='text-left nowrap'>订单状态</th>
                <th class='text-left nowrap'>操作人</th>
                <th class='text-left nowrap'>创建时间</th>
                <th>操作</th>
            </tr>
            </thead>
            {/notempty}
            <tbody>
            {foreach $list as $key=>$vo}
            <tr>
                <td class='nowrap'>
                    {foreach $apps as $s}{eq name='vo.app_id' value='$s.app_id'}{$s.app_name}{/eq}{/foreach}
                </td>
                <td class='nowrap'>{$vo.order_no|default='--'}</td>
                <td class='nowrap'>
                    {foreach $proxys as $s}{eq name='vo.proxy_id' value='$s.id'}{$s.user_nickname}{/eq}{/foreach}
                </td>
                <td class='nowrap'>
                    {foreach $intethalis as $s}{eq name='vo.inte_thaliid' value='$s.inte_id'}{$s.inte_thali_name}{/eq}{/foreach}
                </td>
                <td class='nowrap'>{$vo.order_amount|default='--'}</td>
                <td class="nowrap">
                    {eq name='vo.order_status' value='1'}<span class="layui-badge layui-bg-gray layui-border-cyan">预订单</span>{/eq}
                    {eq name='vo.order_status' value='2'}<span class="layui-badge layui-bg-blue">已支付</span>{/eq}
                    {eq name='vo.order_status' value='3'}<span class="layui-badge layui-bg-black">已取消</span>{/eq}
                </td>
                <td class='nowrap'>
                    {foreach $sysusers as $u}
                    {eq name='u.id' value="$vo.examine_userid|default=''"}
                    <div>审核人：<b>{$u.nickname|default=''}</b></div>
                    {/eq}
                    {/foreach}
                    <div class="sub-strong-blue">状态：<b>
                        {eq name='vo.examine_status' value='0'}<span
                            class="layui-badge layui-bg-gray layui-border-orange">审核中</span>{/eq}
                        {eq name='vo.examine_status' value='1'}<span
                            class="layui-badge layui-bg-gray layui-border-blue">已通过</span>{/eq}
                    </b></div>
                    <div>时间：<span class="color-text">{$vo.examine_time}</span></div>
                </td>
                <td class='nowrap'>{$vo.create_time|default='--'}</td>
                <td class='nowrap sub-strong-blue'>
                    {if isset($type) and $type eq '1'}
                    <!--{if auth("examine")}-->
                    <a class="layui-btn layui-btn-xs layui-btn-danger" data-action="{:url('examine')}" data-confirm="确定收款金额和订单金额一致，便于账单统计，确定要通过后，通过后积分自动下发。" data-value="id#{$vo.id};">通过</a>
                    <!--{/if}-->
                    {else}
                    <a class="layui-btn layui-btn-xs layui-btn-disabled">不可操作</a>
                    {/if}
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
        {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
    </div>
</div>

{/block}